#include("../layout.html")
#@layout("撰写设置")

#define body()
<h1>撰写设置</h1>

<div class="layui-fluid">
	<form class="layui-form" action="/admin/option/writing" method="post">
		<div class="layui-form-item">
    		<label class="layui-form-label">默认文章分类目录</label>
    		<div class="layui-input-block" style="width:200px;">
    			<select name="default_category" id="default_category" data="#(default_category??)">
    				<option>未分类</option>
    			</select>
   	 		</div>
    	</div>
    	<div class="layui-form-item">
    		<label class="layui-form-label">默认文章形式</label>
    		<div class="layui-input-block" style="width:100px;">
    			<select name="default_post_format" id="default_post_format" data="#(default_post_format??)">
					<option value="0">标准</option>
					<option value="aside">日志</option>
					<option value="chat">聊天</option>
					<option value="gallery">相册</option>
					<option value="link">链接</option>
					<option value="image">图像</option>
					<option value="quote">引语</option>
					<option value="status">状态</option>
					<option value="video">视频</option>
					<option value="audio">音频</option>
				</select>
   	 		</div>
    	</div>
    	
    	<h2 class="title">通过电子邮件发布</h2>
    	<p>通过电子邮件发布设定能让您通过发送您文章的内容到WordPress来发布。此信箱接收到的任何信件都将被发布，所以将此地址保密是一个好主意。以下是一些随机字符串供您使用：<kbd>zpML6JNl</kbd>、<kbd>9eI7MxgD</kbd>、<kbd>qvBgz4ig</kbd>。</p>
    	
    	<div class="layui-form-item">
    		<label class="layui-form-label">邮件服务器</label>
    		<div class="layui-input-block">
	    		<div class="layui-inline" style="width:400px;">
	    			<input type="text" name="mailserver_url" id="mailserver_url" value="#(mailserver_url??)" placeholder="" autocomplete="off" class="layui-input">
	   	 		</div>
	   	 		端口
	   	 		<div class="layui-inline" style="width:60px;">
	    			<input type="text" name="mailserver_port" id="mailserver_port" value="#(mailserver_port??)" placeholder="" autocomplete="off" class="layui-input">
	   	 		</div>
   	 		</div>
    	</div>
    	<div class="layui-form-item">
    		<label class="layui-form-label">登录名</label>
    		<div class="layui-input-block" style="width:400px;">
    			<input type="text" name="mailserver_login" id="mailserver_login" value="#(mailserver_login??)" placeholder="" autocomplete="off" class="layui-input">
   	 		</div>
    	</div>
    	<div class="layui-form-item">
    		<label class="layui-form-label">密码</label>
    		<div class="layui-input-block" style="width:400px;">
    			<input type="text" name="mailserver_pass" id="mailserver_pass" value="#(mailserver_pass??)" placeholder="" autocomplete="off" class="layui-input">
   	 		</div>
    	</div>
    	<div class="layui-form-item">
    		<label class="layui-form-label">默认邮件发表分类目录</label>
    		<div class="layui-input-block" style="width:200px;">
    			<select name="default_email_category" id="default_email_category" data="#(default_email_category??)">
    				<option>未分类</option>
    			</select>
   	 		</div>
    	</div>
    	
    	<h2 class="title">更新服务</h2>
    	<p><label for="ping_sites">在您发表新文章时，WordPress会自动通知站点更新服务。要获取更多资讯，请参见Codex上的<a href="https://codex.wordpress.org/Update_Services">更新服务</a>。用换行分隔多个服务URL。</label></p>
    	
    	<div class="layui-form-item">
    		<textarea name="ping_sites" id="ping_sites" placeholder="" class="layui-textarea">#(ping_sites??)</textarea>
    	</div>
    	<div class="layui-form-item">
    		<button type="submit" lay-submit lay-filter="*" class="layui-btn layui-btn-sm">保存更改</button>
    	</div>
    </form>
</div>
#end

#define foot()
<script>
layui.cache.page = 'option';
layui.use('tbynet', function(){
	var $ = layui.$
	,form = layui.form
	,tbynet = layui.tbynet;
	
	$('#default_category').val($('#default_category').attr('data'));
	$('#default_post_format').val($('#default_post_format').attr('data'));
	$('#default_email_category').val($('#default_email_category').attr('data'));
	
	form.render();
});
</script>
#end